<script>
import _ from 'lodash'
import UserService from '@/request/user/user'
export default {
  name: 'AdminUserUser',
  data () {
    return {
      users: []
    }
  },
  methods: {
    listUser () {
      UserService.list().then(res => {
        this.users = _.clone(res.result || [])
      })
    }
  }
}
</script>

<template>
  <el-main>
    <el-button type="primary" @click="listUser">测试</el-button>
    <el-table
      :data="users"
      border
      style="width: 100%">
      <el-table-column
        prop="name"
        label="姓名"
        width="180">
      </el-table-column>
      <el-table-column
        prop="age"
        label="年龄"
        width="120">
      </el-table-column>
      <el-table-column
        prop="phone"
        label="电话"
        width="180">
      </el-table-column>
      <el-table-column
        prop="address"
        label="地址">
      </el-table-column>
    </el-table>
  </el-main>
</template>
